package com.dt76.smallloanbackenduser.remote.huxuan;


import com.dt76.smallloanbackenduser.hystrix.huxuan.SetMationHystrix;
import com.dt76.smallloanbackenduser.pojo.huxuan.Information;
import com.dt76.smallloanbackenduser.pojo.huxuan.Vip;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "smallloan-backend-service",fallback = SetMationHystrix.class)
public interface SetMatonRemote {
    //平台设置
    @RequestMapping("/mation/agreement")
    String qryAgreement();

    @RequestMapping(value = "/mation/update",method = RequestMethod.POST,consumes = "application/json")
    void update(@RequestBody Information information);

    //查询会员设置
    @RequestMapping("/vip/all")
    List<Vip> qryAll();

    //修改会员默认等级
    @RequestMapping(value = "/vip/updRankAll",method = RequestMethod.POST,consumes = "application/json")
    int updRankAll();
    @RequestMapping(value = "/vip/updRank",method = RequestMethod.POST,consumes = "application/json")
    int updRank(@RequestBody Vip vip);
    //删除会员
    @RequestMapping("/vip/delVip")
    void delVip(@RequestParam("id") int id);
    //添加会员
    @RequestMapping(value = "/vip/addVip",method = RequestMethod.POST,consumes = "application/json")
    void addVip(@RequestBody Vip vip);
    //修改会员信息
    @RequestMapping(value ="/vip/updInfo",method = RequestMethod.POST,consumes = "application/json")
    void updInfo(@RequestBody Vip vip);

    //发送邮件
    @RequestMapping("/vip/email")
     void getEmail(@RequestParam("id") int id,
                   @RequestParam("email") String email);
    //发送短信
    @RequestMapping("/vip/sms")
     void getSMS(@RequestParam("id") int id,
                 @RequestParam("num") String num);
}
